package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId      int64   `gorm:"type:int"`
	GoodsId     int64   `gorm:"type:int"`
	OrderSn     string  `gorm:"type:char(36);unique;not null"`
	OrderAmount float64 `gorm:"type:decimal(10,2)"`
	OrderStatus int     `gorm:"type:tinyint(1);default:1"`
}

func (o *Order) Create() error {
	return DB.Debug().Create(&o).Error
}
